#!/usr/bin/env python

# -------------------------------
# projects/python/primes/main.py
# Copyright (C) 2009
# Glenn P. Downing
# -------------------------------

# To run the program
#     main.py < Primes.in > Primes.out

# To document the program
#     pydoc -w main

from math import sqrt

# -------
# globals
# -------

data = 0; # input: don't change after reading
primes = [True] * 3163
answer1 = 0
answer2 = 0
answer3 = 0
answer4 = 0
possible = True


# -----------
# InputReader
# -----------

class InputReader (object) :
    def read (self) :
        return raw_input()

# ------------
# OutputWriter
# ------------

class OutputWriter (object) :
    def write (self, *a) :
        for w in a :
            print w,
        print

# -------
# my_read
# -------

def my_read (r) :
    """
    reads an int into data
    return true if that succeeds, false otherwise
    """
    global data
    try :
        data = int(r.read())
    except EOFError :
        return False
    return True

# -------
# my_eval
# -------

def my_eval () :
    """
    computes the 4 primes of the number in data
    and stores the result in answer1, answer2, answer3, answer4
    or raises the flag impossible
    """
    global data
    global answer1
    global answer2
    global answer3
    global answer4
    global possible

    #even number being the sum of 2 primes
    possible = True

    #check if odd
    if ((data&1) == 1):
        answer1 = 2
        answer2 = 3
    #check if even
    else:
        answer1=2;
        answer2=2;

    #looks for the sum of 2 primes backwards and forwards
    for i in range(2, (data-answer1-answer2) ):
          if( isPrime(i) and isPrime(data-answer1-answer2-i) ):
              answer3 = i
              answer4 = data-answer1-answer2-i
              return

    #set global variable false
    possible = False



# -------
# my_eval
# -------

def isPrime (x) :
    """
    Checks if a given number 'x' is prime against the prime cache
    """
    assert x > 0 and sqrt(x) < x # asserts that the square root is within the range of our cache
    global primes
    if x < 3163 : # if X is in the cache range, return that
	return primes[x]
    
    for i in range(2, int(sqrt(x))+1) : # check all primes to see if they divide X
	if primes[i] :
	    if x % i == 0 :
		return False
			    
    return True
	


# -------
# my_eval
# -------

def primeCache () :
    """
    Updates a list of primes
    """

    global primes
    primes[0] = False
    primes[1] = False
    for x in range(2, 3163) : # Through the range of the primes, remove multiples of already cached primes
	if primes[x] :
	    j = 2
	    while x*j < 3163 :
		primes[x*j] = False
		j += 1


# --------
# my_print
# --------

def my_print (w) :
    """
    writes the values of primes stores in answer1, answer2, answer3 and answer4 or prints "Impossible."
    """
    if (possible):
        w.write(answer1, answer2, answer3, answer4)
    else:
        w.write("Impossible.")

# ----
# main
# ----

def main () :
    """
    runs the program
    """

    primeCache()

    while my_read(InputReader()) :
        my_eval()
        my_print(OutputWriter())

if __name__ == "__main__" :
    main()
